<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>javascript 阶段</title>
</head>
<body>
    <h3>构造函数属性： constructor</h3>

    <script>
         // 构造函数
         function People(){}
         // 实例对象
         var xiaoming = new People();

        //  打印原型
        console.log(People.prototype);// {constructor: ƒ}
        console.log(People.prototype.constructor);// 构造函数
        console.log(People.prototype.constructor === People);// true

        // 通过实例对象的隐式原型
        console.log(xiaoming.__proto__.constructor === People);// true


        // 问题:
        // 判断数组和对象
        // Array   Object
        
        // 数组
        var arr = [];
        console.log(typeof arr);// object
        console.log(arr.__proto__);//Array
        console.log(arr.__proto__.constructor === Array);// true
        console.log(arr.__proto__.constructor === Object);// false


        // 对象
        var obj = {};
        console.log(typeof obj);// object
        console.log(obj.__proto__.constructor === Object);// true

        // 作用: 找原型对象所属的构造函数



    </script>
</body>
</html>